package com.jxdinfo.hussar.activitidemo.utils;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/11.
 */
public class TreeBean {
    private String id;
    private String text;
    private String state;

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state =state;
    }

    //    private String pId;
    private String p_level;
    private List<TreeBean> children;

    public TreeBean() {
    }

    public TreeBean(String id, String name,String level,String state) {
        super();
        this.id = id;
        this.text = name;
        this.p_level = level;
        if(Integer.parseInt(state)<4&&!id.equals("0")){
            this.state="closed";
        }else {
            this.state="open";
        }

//        this.pId=pId;
    }

    public TreeBean addChild(TreeBean child) {
        if (this.children == null)
            this.children = new LinkedList<TreeBean>();
        this.children.add(child);
        return this;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

//    public String getName() {
//        return name;
//    }
//
//    public void setName(String name) {
//        this.name = name;
//    }

//    public String getpId() {

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

//        return pId;
//    }
//
//    public void setpId(String pId) {
//        this.pId = pId;
//    }


    public String getP_level() {
        return p_level;
    }

    public void setP_level(String p_level) {
        this.p_level = p_level;
    }

    public List<TreeBean> getChildren() {
        return children;
    }

    public void setChildren(List<TreeBean> children) {
        this.children = children;
    }
}
